home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / CurrencyTextFieldBeanInfo.java < prev    next >
Text File  |  1998-10-26  |  4KB  |  94 lines

  1. package com.symantec.itools.awt;
  2.  
  3. import java.beans.*;
  4. import java.util.ResourceBundle;
  5. import java.awt.Image;
  6. import com.symantec.itools.beans.HelperBeanInfo;
  7. import com.symantec.itools.vcafe.beans.PropertyDescriptorAttributes;
  8.  
  9. //  08/19/98    LAB    Moved to GroupAWTAdditions folder.
  10. //  10/06/98    VJ    Added code for grouping together currency properties
  11.  
  12. public class CurrencyTextFieldBeanInfo extends HelperBeanInfo {
  13.     protected final static String m_WinHelpID = "0x123AE";
  14.     
  15.     public CurrencyTextFieldBeanInfo() {
  16.         setInheritSuperBeanInfo(true);
  17.         
  18.         ResourceBundle group = ResourceBundle.getBundle("com.symantec.itools.awt.GroupBundle");
  19.         String s = group.getString("GroupAWTAdditions");
  20.  
  21.         setComponentLibraryFolder(s);
  22.         setToolbarFolder(s);        
  23.         //setWinHelpKey(m_WinHelpID);                    
  24.         
  25.         // set icons
  26.         set16x16ColorIconName("curr16.gif");
  27.         set32x32ColorIconName("curr32.gif");
  28.         set16x16MonoIconName("curr16bw.gif");
  29.         set32x32MonoIconName("curr32bw.gif");        
  30.     }
  31.  
  32.     protected Class getBeanClass()
  33.     {
  34.         return beanClass;
  35.     }
  36.  
  37.     //VJ start
  38.     public PropertyDescriptor[] getPropertyDescriptors() {
  39.         try{
  40.             /*
  41.             We don't want to display dataText - puru (10/26/98)
  42.         PropertyDescriptor dataText = new PropertyDescriptor("dataText", beanClass,"getDataText",null);
  43.         dataText.setBound(false);
  44.         dataText.setConstrained(false);
  45.         dataText.setDisplayName("Data Text");
  46.         dataText.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  47.            */
  48.  
  49.         PropertyDescriptor decimalPoint = new PropertyDescriptor("decimalPoint", beanClass);
  50.         decimalPoint.setBound(false);
  51.         decimalPoint.setConstrained(false);
  52.         decimalPoint.setDisplayName("Decimal Point");
  53.         decimalPoint.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  54.  
  55.         PropertyDescriptor digitsAfterDecimal = new PropertyDescriptor("digitsAfterDecimal", beanClass);
  56.         digitsAfterDecimal.setBound(false);
  57.         digitsAfterDecimal.setConstrained(false);
  58.         digitsAfterDecimal.setDisplayName("Digits After Decimal");
  59.         digitsAfterDecimal.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  60.  
  61.         PropertyDescriptor currencyLeading = new PropertyDescriptor("currencyLeading", beanClass);
  62.         currencyLeading.setBound(false);
  63.         currencyLeading.setConstrained(false);
  64.         currencyLeading.setDisplayName("Leading Symbol");
  65.         currencyLeading.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  66.  
  67.         PropertyDescriptor separator = new PropertyDescriptor("separator", beanClass);
  68.         separator.setBound(false);
  69.         separator.setConstrained(false);
  70.         separator.setDisplayName("Separator");
  71.         separator.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  72.  
  73.         PropertyDescriptor separatorEnabled = new PropertyDescriptor("separatorEnabled", beanClass);
  74.         separatorEnabled.setBound(false);
  75.         separatorEnabled.setConstrained(false);
  76.         separatorEnabled.setDisplayName("Separator Enabled");
  77.         separatorEnabled.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  78.  
  79.         PropertyDescriptor currencySymbol = new PropertyDescriptor("currencySymbol", beanClass);
  80.         currencySymbol.setBound(false);
  81.         currencySymbol.setConstrained(false);
  82.         currencySymbol.setDisplayName("Symbol");
  83.         currencySymbol.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  84.  
  85.          PropertyDescriptor[] rv = {currencySymbol,currencyLeading,decimalPoint,digitsAfterDecimal,
  86.                                      separator,separatorEnabled};
  87.  
  88.         return rv;
  89.         } catch (IntrospectionException e) { throw new Error(e.toString()); }
  90.     }
  91.     //VJ end
  92.     private final static Class beanClass = CurrencyTextField.class;
  93. }
  94.